#ifndef LEGENDLABEL_H
#define LEGENDLABEL_H

#include <QLabel>
#include <QEvent>
#include <QDebug>

class LegendLabel : public QLabel
{
    Q_OBJECT
public:
    explicit LegendLabel(QWidget *parent = nullptr);
    ~LegendLabel();
    void setIndex(int n);
    int getIndex();

protected:
    bool event(QEvent *event);                              // 事件

private:
    int index;

signals:
    void mouseClicked();                                    // 鼠标点击

};

#endif // LEGENDLABEL_H
